package day03.homework.standard;

/**
 * 算术运算符
 */
public class SuanShuOper1 {
    public static void main(String[] args) {
        System.out.println("1.输出几个整数取模，验证结果");
        int a = 25, b = 89, c = 46;
        int d = a % 2;
        System.out.println(d);// 1
        System.out.println(b % 8);// 1
        System.out.println(c % 2);// 0

        System.out.println("2.演示单独使用时的自增和自减");
        int e = 4;
        int f = 8;
        e++;
        System.out.println(e);// 5
        ++e;
        System.out.println(e);// 6
        f--;
        System.out.println(f);//7
        --f;
        System.out.println(f);//6

        System.out.println("3.声明几个整型变量，演示被使用时的自增和自减");
        // 自减
        int g = 16, h = 12;
        int g1 = g--;
        int h1 = --h;
        System.out.println(g);// 15
        System.out.println(h);// 11
        System.out.println(g1);// 16
        System.out.println(h1);// 11

        // 自增
        int i = 5, j = 8;
        int i1 = i++;
        int j1 = ++j;
        System.out.println(i1);// 5
        System.out.println(j1);// 9
        System.out.println(i); // 6
        System.out.println(j); // 9


    }
}
